{% extends 'ThemeBundle:Default:base.html.twig' %}
{% block contenido %}
{% block javascripts %}
<script>
    $(document).ready(function() {
        {#$('#password_restart').click(function() {
            $('.modal').modal();
        });#}
        $('#yes').click(function() {
            //
            $('#pasantias_usuariosbundle_usuariostype_password').val('123456');
            $('#myModal').modal('hide');

        });
    });

</script>

{% endblock %}
<div class="modal fade"id="myModal" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title">Aviso</h4>
            </div>
            <div class="modal-body">
                <p>Esta seguro que desea reestablecer la contraseña</p>
            </div>
            <div class="modal-footer">        
                <button type="button" id="yes" class="btn btn-primary">Aceptar</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">Cancelar</button>
            </div>
        </div>
    </div>
</div>
<form class="form-horizontal" action="{{ path('usuarios_update', { 'id': entity.id }) }}" method="post" {{ form_enctype(form) }}>
    <fieldset>
        <legend>Edicion de Usuarios</legend>
        {{form_errors(form)}}
        {{ form_row(form.usuario) }}
        <div class="form-group">
            <label class="col-lg-2 control-label required" >Reestablecer Contraseña</label>
            <div class="col-lg-10">
                <button type="button" class="btn btn-info" data-toggle="modal" data-target="#myModal">
                    Reiniciar Password</button>
{#                <button id="password_restart" class="btn btn-info" type="button">Reiniciar Password</button>#}
            </div>

        </div>
        {{ form_row(form.mail) }}
        {{ form_row(form.activo) }}
        {{ form_row(form.perfil) }}
    </fieldset>
    {{form_rest(form)}}
    <div class="pull-right">
        <button class="btn btn-primary" type="submit">Guardar</button>
        <a class="btn btn-default" href="{{ path('usuarios') }}">
            Volver
        </a>

    </div>
</form>

{%endblock%}